﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using System.Globalization;
using System.Threading;

namespace IDE_week2_Forms_project
{
    public partial class Form1 : Form
    {
        Boolean isger = false;
        public Form1()
        {
            InitializeComponent();
        }

        private void onform_Click(object sender, EventArgs e)
        {
            Form2 test = new Form2();
            test.Visible = true;
        }

        private void Form1_Load(object sender, EventArgs e)
        {

        }

        private void cicon_Click(object sender, EventArgs e)
        {
            this.Icon = Properties.Resources.ICON2;
        }

        private void ricon_Click(object sender, EventArgs e)
        {
            Form a = new Form();

            this.Icon = a.Icon;

        }

        private void ChangeLanguage(string lang)
        {
            foreach (Control c in this.Controls)
            {
                ComponentResourceManager resources =
                      new ComponentResourceManager(typeof(Form1));
                resources.ApplyResources(c, c.Name, new CultureInfo(lang));
            }
        }

        private void clang_Click(object sender, EventArgs e)
        {
            
            if (isger == false)
            {
                ChangeLanguage("de-DE");
                isger = true;
            }
            else
            {
                ChangeLanguage("en-GB");
                isger = false;
            }
        }

        private void cc1_Click(object sender, EventArgs e)
        {
            int[] numbers = new int[10];
            Class1.MakeRandomNumber(numbers);
            label1.Text = numbers[0] + ", " + numbers[1] + ", " + numbers[2];
        }
    }
}
